package draw.common.exception;

import draw.common.exceptionCode.ExceptionCodeModel;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
public class ServerException extends RuntimeException {

    Integer code;

    String message;

    public ServerException() {}

    public ServerException(ExceptionCodeModel e) {
        code = e.getCode();
        message = e.getMessage();
    }

    public ServerException(ExceptionCodeModel e,String msg) {
        code = e.getCode();
        message = e.getMessage()+": "+msg;
    }

    public ServerException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}

